<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
session_start(); //we need to call PHP's session object to access it through CI
class Home extends CI_Controller {
	function __construct()
	{
		parent::__construct();
	}

	function index()
	{
		$this->load->model('home_model','',TRUE);
		$session_data = $this->session->userdata('logged_in');
		$data['username'] = $session_data['username'];
		$data['result'] = $this->home_model->getData();
		$data['contents'] = $this->load->view('home_view',$data,true);
		$data['page_title'] = "Twin Tulipware";
		$this->load->view('template_default',$data);
	}

	function logout()
	{
		$this->session->unset_userdata('logged_in');
		$this->session->sess_destroy();
		session_destroy();
		redirect('login', 'refresh');
	}
}
?>